import 'package:flutter/material.dart';
import 'package:sz/tools/tools.dart';

// 招聘列表中一项
class RecruitListOne extends StatelessWidget {
  const RecruitListOne({super.key});

  @override
  Widget build(BuildContext context) {
    return Container(
      width: getScreenWidth,
      margin: EdgeInsets.only(left: rpx(24), right: rpx(24), bottom: rpx(24)),
      padding: EdgeInsets.all(rpx(20)),
      decoration: BoxDecoration(
        color: Colors.white,
        borderRadius: BorderRadius.circular(
          rpx(20),
        ),
      ),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              SizedBox(
                width: rpx(500),
                child: Text(
                  'dataasdfadsgasdgasdgasdgfdsdasdfasdgadsgadssd',
                  style: TextStyle(
                      fontWeight: FontWeight.w700, fontSize: setSp(32)),
                  maxLines: 1,
                  overflow: TextOverflow.ellipsis,
                ),
              ),
              const Text(
                '8k-10k',
                style: TextStyle(
                    color: SzColor.primary, fontWeight: FontWeight.w600),
              )
            ],
          ),
          SizedBox(
            height: rpx(16),
          ),
          Wrap(
            children: [
              buildBgText('西藏自治区拉萨市全市'),
              buildBgText('3-5年'),
              buildBgText('本科'),
            ],
          ),
          Row(
            children: [
              Image.asset(
                'images/imgs/zhipin/company.png',
                width: rpx(40),
                height: rpx(40),
              ),
              SizedBox(
                width: rpx(10),
              ),
              SizedBox(
                width: rpx(500),
                child: Text(
                  '极易净水科技(A)有限公司',
                  style: TextStyle(
                    fontSize: setSp(26),
                  ),
                ),
              )
            ],
          )
        ],
      ),
    );
  }

  ///背景文字
  Container buildBgText(String text, {double bottom = 16}) {
    return Container(
      decoration: BoxDecoration(
        color: SzColor.f4f4f4,
        borderRadius: BorderRadius.circular(rpx(4)),
      ),
      margin: EdgeInsets.only(
        right: rpx(20),
        bottom: rpx(bottom),
      ),
      padding: EdgeInsets.symmetric(
        horizontal: rpx(4),
        vertical: rpx(2),
      ),
      child: Text(
        text,
        style: TextStyle(
          fontSize: setSp(24),
          color: SzColor.c3,
        ),
      ),
    );
  }
}
